﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SGRapidForm.Foundation.Service.Interface;
using SGRapidForm.Foundation.Component;
using SGRapidForm.Foundation.Entity;

namespace SGRapidForm.Foundation.Service
{
    /// <summary>
    /// 基础资料类别服务
    /// </summary>
    public partial class FoundationService : IFoundationService
    {
        private FoundationClassComponet foundationClassComponet;
        public FoundationClassComponet FoundationClassComponet
        {
            get
            {
                if (foundationClassComponet == null)
                {
                    this.foundationClassComponet = new FoundationClassComponet();
                }
                return this.foundationClassComponet;
            }
            set { foundationClassComponet = value; }
        }
        /// <summary>
        /// 查询所有基础资料类别的所有信息
        /// </summary>
        /// <returns>返回集合</returns>
        public List<FoundationClassEntity> GetFoundationClassList()
        {
            return this.FoundationClassComponet.GetFoundationClassList();
        }
        public bool GetAllList()
        {
            return true;
        }

        /// <summary>
        /// 进行过滤、排序、分页查询基础资料类别记录数
        /// </summary>
        /// <param name="filterConditions">过滤条件</param>
        /// <returns>记录数</returns>
        public int GetFoundationClassCount(string filterConditions)
        {
            return this.FoundationClassComponet.GetFoundationClassCount(filterConditions);
        }
        /// <summary>
        /// 进行过滤、排序、分页查询基础资料类别
        /// </summary>
        /// <param name="startRecord">开始记录索引</param>
        /// <param name="maxRecords">每页记录数</param>
        /// <param name="sortColumns">排序列</param>
        /// <param name="filterConditions">过滤条件SQL</param>
        /// <returns>基础资料类别集合</returns>
        public List<FoundationClassEntity> GetFoundationClass(Int32 startRecord, Int32 maxRecords, String sortColumns, String filterConditions)
        {
            return this.FoundationClassComponet.PagingGetFoundationClass(startRecord, maxRecords, sortColumns, filterConditions);
        }

        /// <summary>
        /// 根据keyid来获取一条记录信息
        /// </summary>
        /// <param name="keyid">一个记录的keyid</param>
        /// <returns>返回记录的所有信息</returns>
        public FoundationClassEntity GetFoundationClassByKeyid(string keyid)
        {
            return this.FoundationClassComponet.GetFoundationClassByKeyid(keyid);
        }

        /// <summary>
        /// 根据keyid来删除一条记录
        /// </summary>
        /// <param name="keyid">一条记录keyid</param>
        /// <returns>是否删除成功</returns>
        public bool DeleteFoundationClass(string keyid)
        {
           
            return this.FoundationClassComponet.DeleteFoundationClass(keyid);
        }

         /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="keyids">keyids</param>
        /// <returns>批量删除是否成功</returns>
        public bool Foundation_BulkDelete(string keyids)
        {
            return this.FoundationClassComponet.BulkDeleteFoundation(keyids);
        
        }
        /// <summary>
        /// 更新一条基础资料类别
        /// </summary>
        /// <param name="UserDetails">一条类别记录</param>
        /// <returns>是否更新成功</returns>
        public bool UpdateFoundationClass(FoundationClassEntity foundationClass)
        {
            return this.FoundationClassComponet.UpdateFoundationClass(foundationClass);
        }

        /// <summary>
        /// 新增一条基础类别记录
        /// </summary>
        /// <param name="foundationClass">一条类别记录的信息</param>
        /// <returns>是否新增成功</returns>
        public bool AddFoundationClass(FoundationClassEntity foundationClass)
        {
            return this.FoundationClassComponet.AddFoundationClass(foundationClass);
        }
    }
}
